package iosr11.data;

public class Attendence extends Entity{
	private Student student;
	private Event event;
	private int pressence;
	
	public Attendence(){
		
	}
	
	public Attendence(String id, Student student, Event event, int pressence){
		super(id);
		this.student = student;
		this.event = event;
		this.pressence = pressence;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public Event getEvent() {
		return event;
	}

	public void setEvent(Event event) {
		this.event = event;
	}

	public boolean getPressence() {
		if (this.pressence>0)
			return true;
		else return false;
	}
	
	public int getPressenceI() {
		return this.pressence;
	}

	public void setPressence(int pressence) {
		this.pressence = pressence;
	}
	
	public void setPressence(boolean pressence) {
		if(pressence) this.pressence=1;
		else this.pressence=0;
	}
	
	public String toString(){
		StringBuffer buf = new StringBuffer();
		buf.append(this.getId());
		buf.append("\n");
		buf.append(student.getId());
		buf.append("\n");
		buf.append(event.getId());
		buf.append("\n");
		buf.append(pressence);
		buf.append("\n");
		return buf.toString();
	}
}
